package com.kehutong.charge.util;

import com.coraframework.quartz.Job;
import com.coraframework.quartz.JobExecutionContext;
import com.coraframework.quartz.JobExecutionException;
import com.kehutong.charge.service.CommonService;
import org.coraframework.logger.Logger;
import org.coraframework.logger.LoggerFactory;
import org.coraframework.util.Ioc;

/**
 *  缴费定时任务
 */
public class ChargeOrderInterimJob implements Job {

    private static final Logger logger = LoggerFactory.getLogger(ChargeOrderInterimJob.class);

    private CommonService commonService;

    public ChargeOrderInterimJob() {
        this.commonService = Ioc.getInstance(CommonService.class);
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            logger.info("执行缴费订单定时任务开始！");
            commonService.updateOrderInterimTask();
        } catch (Exception e) {
            logger.error("执行缴费订单定时任务开始！", e);
        }
    }

}
